package com.itheima.day2.currying;

public class Carrying0Demo {

    public static void main(String[] args) {
        Fx fx = new FxImpl();
        Fy fy = fx.op(10);
        fy.op(20);
    }
}

@FunctionalInterface
interface Fx {
    Fy op(int a);
}

@FunctionalInterface
interface Fy {
    int op(int b);
}

class FxImpl implements Fx {
    @Override
    public Fy op(int a) {
        return new FyImpl(a); // 将a传递给FyImpl
    }
}

class FyImpl implements Fy {
    private final int a;

    public FyImpl(int a) {
        this.a = a;
    }

    @Override
    public int op(int b) {
        return a + b;
    }
}